from urllib.request import urlopen
import json
print("读取“天气预报Json”文件，要求输出苏州市未来3天的温度和天气情况。")
fr = open("天气预报json.txt","rt",encoding = "utf-8")
ls = fr.readlines()
fr.close
s1 = "".join(ls)
print(s1)
s2  =  json.loads(s1)
result = s2.get("result").get("future")
print("苏州市未来3天的温度和天气情况为：\n"
       +result[0].get("date")+","+result[0].get("temperature")+","+result[0].get("weather")+"\n"
       +result[1].get("date")+","+result[1].get("temperature")+","+result[1].get("weather")+"\n"
       +result[2].get("date")+","+result[2].get("temperature")+","+result[2].get("weather")+"\n"
      )
